Search results

Types

Classes
Interfaces
Enums
Functions
Type aliases
Constants

Members

Properties
Methods
Getters
Setters
Enum members
Show privates

Other

In this module only

Class SongSearcher

Defined in SongSearcher.ts

Constructor

constructor(options?: SongSearcherOptionsinterface SongSearcherOptionsutils/SongSearcherOptions)

Creates a new SongSearcher

· options - undefined

Properties

private _limit = 10[src]

Methods

search(
args: string,
options?: SearchOptionsinterface SearchOptionsutils/SearchOptions
): Promiseexternal Promise<SearchedSonginterface SearchedSongutils/SearchedSong[]>
[src]

Searchs a song

· args - undefined
· options - undefined

Returns

undefined
extractVideoInfo(url: string): Promiseexternal Promise<Songinterface Songutils/Song>[src]

Extracts infos from a YouTube video

· url - undefined

Returns

undefined
fetchPlaylist(url: string): Promiseexternal Promise<SearchedPlaylistinterface SearchedPlaylistutils/SearchedPlaylist[]>[src]

Searchs a playlist and returns the 100 first songs of it. This method also works for YouTube mixes.

· url - The YouTube playlist url.

Returns

undefined
extractPlaylistInfo(url: string): Promiseexternal Promise<Playlistinterface Playlistutils/Playlist>[src]

Extracts playlist title and description. Works for YouTube mixes too. The returned description will be empty if the inserted link is a mix.

· url - The YouTube playlist url.

Returns

undefined
getLyrics(query: string): Promiseexternal Promise<SongLyricsinterface SongLyricsutils/SongLyrics | undefined>[src]

Gets a song lyrics

· query - Song title

Returns

undefined

Example

undefined
private _addResults(results: any[], returnData: SearchedSonginterface SearchedSongutils/SearchedSong[]): void[src]

Adds results for a searched video

· results - undefined
· returnData - undefined
private _initInnerTubeApiKey(): Promiseexternal Promise<void>[src]

Gets an InnerTube API key and set the Innertube context, depending on your computer

Returns

undefined
private _generateExtractBody(url: string): object[src]

Generates body to fetch YouTube API

· url - undefined

Returns

undefined
private _humanizeSeconds(secs: number): string[src]

Humanizes seconds

· secs - undefined

Returns

undefined